<div id="report-container" class="container">
    <div id="msg-container">
        <h2 class="error-tips"></h2>
    </div>
    <form method="POST" action="{:U('Report/add',array('type'=>$type,'rid'=>$rid))}">
        <h2 class="headline">{$Think.lang.report_headline}</h2>
        <p>{$Think.lang.report_tips}</p>
        <h2>{$Think.lang.report_reason}</h2>
        <ul class="reasons">
            <volist name="reasons" id="vo">
            <li><input id="reason-{$key}" type="radio" name="reason_id" value="{$key}" <eq name="key" value="1">checked</eq> /> <label for="reason-{$key}">{$vo}</label></li>
            </volist>
        </ul>
        <h2>{$Think.lang.report_further_reason}</h2>
        <textarea id="reason" name="reason" rows="5" cols="80"></textarea>
        <p id="reason-counter" class="counter"></p>
        <h2>{$Think.lang.report_happen_next}</h2>
        <p>{$Think.lang.report_happen_next_explain}</p>
        <eq name="captcha" value="1">
        <div class="captcha-container"><label for="verify">{$Think.lang.captcha}:</label><input id="verify" class="verify" type="text" name="verify" value="" /><img class="captcha" src="{:U('Ajax/captcha')}" title="{$Think.lang.captcha_again}" onclick="reCaptcha(this);" /></div>
        </eq>
        <div class="text-right">
            <input id="btn-submit" class="button" type="submit" value="{$Think.lang.submit}" />
        </div>
    </form>
</div>

<load href="__PUBLIC__/Js/jquery.artTxtCount.js" />
<script type="text/javascript">
$(function(){
    $('#reason').artTxtCount($('#reason-counter'), 255);
    $('#btn-submit').click(function(){
        var url = "{:U('Report/add')}";
        var data = {
            type: '{$type}',
            rid: '{$rid}',
            reason_id: $('input[name=reason_id]').val(),
            reason: $('#reason').val(),
            verify: $('#verify').val()
        };
        $.post(url, data, function(json){
            var json = eval('('+json+')');
            if(json.status == 0){
                $('#msg-container>h2').html(json.info);
                return false;
            }else{
                $('#msg-container>h2').attr('class','success-tips').html(json.info);
                $('#btn-submit').attr({disabled:true, class:'alt-button'});
                setTimeout(function(){
                    $.dialog.get(data.rid).close();
                }, WAIT_TIME);
            }
        });
        return false;
    });
});
</script>
